//科目资讯列表。
Ext.define("ES.view.information.InformationList",{
    extend:"Ext.grid.Panel",
    alias:"widget.InformationTabList",
    closable:true,
    title:"科目资讯",
    store:"InformationStore",
    infoTypeStore:null,
    infoStatusStore:null,
    selType:"checkboxmodel",
    multiSelect:true,
    frame:true,
    layout:{
        type:"fit",
        align:"stretch"
    },
    sortableColumns:false,
    viewConfig:{
        forceFit:true,
        columnLines:true,
        stripRows:true
    },
    tbar:{
        xtype:"toolbar",
        height:36,
        items:["资讯名称：",{
                xtype:"textfield",
                width:168
        }," ",{
                xtype:"button",
                action:"btnQuery",
                iconCls:'search-trigger-icon',
                text:"检索",
                tooltip:"检索数据"
        },"->",{
                xtype:"button",
                action:"btnAdd",
                iconCls:"add-icon",
                text:"新增",
                tooltip:"新增数据"
        },"-",{
                xtype:"button",
                action:"btnDelete",
                iconCls:"delete-icon",
                text:"删除",
                tooltip:"删除数据"
        }]
    },
    bbar:{
        xtype:"pagingtoolbar",
        store:"InformationStore",
        displayInfo:true
    },
    columns:[{
                header:"序号",
                width:32,
                align:"right",
                xtype:"rownumberer"
             },{
                text:"资讯名称",
                width:168,
                flex:1,
                align:"left",
                menuDisabled:true,
                sortable:false,
                dataIndex:"infoTitle"
              },{
                text:"所属科目",
                width:198,
                flex:2,
                align:"left",
                menuDisabled:true,
                sortable:false,
                dataIndex:"fullCatalogName"
              },{
                text:"类型",
                width:90,
                align:"center",
                menuDisabled:true,
                sortable:false,
                dataIndex:"type",
                renderer:function(val){
                    if(this.infoTypeStore != null){
                        return this.infoTypeStore.getText(val);
                    }
                    return val;
                }
              },{
                text:"创建用户",
                width:128,
                align:"left",
                menuDisabled:true,
                sortable:false,
                dataIndex:"createEmployeeName"  
              },{
                text:"状态",
                width:90,
                align:"center",
                menuDisabled:true,
                sortable:false,
                dataIndex:"status",
                renderer:function(val){
                    if(this.infoStatusStore != null){
                        return this.infoStatusStore.getText(val);
                    }
                    return val;
                }
              },{
                text:"创建时间",
                width:72,
                align:"center",
                menuDisabled:true,
                sortable:false,
                dataIndex:"createTime",
                renderer:function(val){
                    return Ext.Date.format(val, "Y-m-d");
                }
              }],
    initComponent:function(){
        this.callParent(arguments);
    },
    setEnumTypeStore:function(type){
         this.infoTypeStore = type;
    },
    setEnumStatusStore:function(status){
        this.infoStatusStore = status;
    }
})